cmake_minimum_required (VERSION 3.16)

project ("ciallo_imgui_sandbox" LANGUAGES CXX)

set (CMAKE_INSTALL_PREFIX ${CMAKE_ROOT}/install) # somehow this is not working

nanobind_add_module(my_ext my_ext.cpp)

nanobind_add_stub(
  my_ext_stub
  INSTALL_TIME
  MODULE my_ext
  OUTPUT ${CMAKE_SOURCE_DIR}/bin/my_ext.pyi
  PYTHON_PATH $<TARGET_FILE_DIR:my_ext>
  DEPENDS my_ext
)

add_executable(
	ciallo_imgui_sandbox

	main.cpp
)
target_include_directories(
	ciallo_imgui_sandbox

	SYSTEM PUBLIC

	${CMAKE_CURRENT_SOURCE_DIR}
)

target_link_libraries(
	ciallo_imgui_sandbox

	PUBLIC

	ciallo_imgui
)

install(TARGETS
	ciallo_imgui_sandbox
	my_ext
	RUNTIME DESTINATION bin
	LIBRARY DESTINATION bin
	ARCHIVE DESTINATION bin
)
# install(FILES
# 	{}my_ext.pyi
# 	DESTINATION bin
# )